import { Responseboolean, ResponseIPageActivityInfo } from '@/types/apiType';

import request from '../utils/request';
import { RequestConfig } from '../utils/request/type';

/**
 * @description
 * @tags 活动接口
 * @summary 活动列表
 * @request get:/api/activity/list
 */
export const apiActivityListByGet = (
  params: { pageNo?: number; pageSize?: number },
  config?: RequestConfig
) =>
  request
    .get<ResponseIPageActivityInfo>(`/api/activity/list`, params, config)
    .then((res) => res?.result);

/**
 * @description
 * @tags 活动接口
 * @summary 是否可以参与活动
 * @request get:/api/activity/participable
 */
export const apiActivityParticipableByGet = (config?: RequestConfig) =>
  request.get<Responseboolean>(`/api/activity/participable`, {}, config).then((res) => res?.result);
